<?php
function disp($data)
{
    echo $data, PHP_EOL;
}

/**
 * @param null $prompt
 * @param bool $rtrim
 * @return bool|string
 * @ref https://docs.segmentfault.com/python~3.6/library/functions#input
 */
function input($prompt = null, $rtrim = true)
{
    if (is_string($prompt)) {
        echo $prompt;
    }
    if ($input = fgets(STDIN)) {
        return $rtrim ? rtrim($input) : $input;
    } else {
        throw new RuntimeException('No more data, or error occurred');
    }
}
